/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __FIFO_H
#define __FIFO_H

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* Exported types ------------------------------------------------------------*/
typedef struct {
  __IO uint16_t     len;
  __IO uint8_t      *buf;
  __IO uint8_t wrIdx;
  __IO uint8_t rdIdx;
} FIFOBuf;

/* Exported functions ------------------------------------------------------- */
void FBPtrInc (__IO FIFOBuf* buffer, __IO uint8_t* ptr);
void FBPtrDec (__IO FIFOBuf* buffer, __IO uint8_t* ptr);
uint8_t FBGetFreeBytes (__IO FIFOBuf* buffer);
int8_t FBCopyFromArray(__IO FIFOBuf* buffer, uint8_t* array, uint8_t n);
#endif /* __FIFO_H */
